<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%--<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">--%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="bootstrap/css/bootstrap-table.css">
<script type="text/javascript" src="bootstrap/js/jquery-3.2.1.js"></script>
<script type="text/javascript" src="bootstrap/js/bootstrap.js"></script>
<script type="text/javascript" src="bootstrap/js/bootstrap-table.js"></script>
<script type="text/javascript" src="bootstrap/js/bootstrap-table-zh-CN.js"></script>
<script type="text/javascript">
	$(function() {
		//发送请求,获取不可用资产一览
		$("#table").bootstrapTable({   
		    url:'prdServlet?flag=worthless',//请求
		    columns:[[    
		        {field:'asId',title:'资产编号',width:100},    
		        {field:'asSpec',title:'型号',width:100},
		        {field:'asState',title:'状态',width:100,formatter: function(value,row,index){
						if (value=='1'){
							return '待用';
						} else if(value==2) {
							return '申请中';
						} else if(value==3) {
							return '在用';
						}else if(value==4) {
							return '报废';
						}
					}
		        },
		        {field:'asDate',title:'购买日期',width:100},    
		        {field:'asDefect',title:'保修期',width:100},    
		        {field:'isBreak',title:'是否故障',width:100,formatter: function(value,row,index){
					if (value=='1'){
						return '故障';
					}else if(value==0) {
						return '正常';
					} 
				}
			},  
		    ]]    
		}); 
	});
</script>
</head>
<body>
	<h2>不可用资产一览</h2>
	<table id="table"></table>
</body>
</html>